package com.ease.common.vo;

import java.io.Serializable;

/**
 * name: http://address:port/context
 * 
 * @author nathanleewei
 * 
 */
public class Endpoint implements Serializable {

	/**
	 *
	 */
	private static final long serialVersionUID = -5238208402549390968L;

	public Endpoint() {
	}

	public Endpoint(String name) {
		this.setName(name);
	}

	private String name;

	private String address;

	private int port;

	private String context;

	public String toString() {
		StringBuilder sb = new StringBuilder();
		sb.append(name).append(":http://").append(address).append(":").append(port).append("/").append(context);
		return sb.toString();
	}

	/**
	 * @return the name
	 */
	public String getName() {
		return name;
	}

	/**
	 * @param name
	 *            the name to set
	 */
	public void setName(String name) {
		this.name = name;
	}

	/**
	 * @return the address
	 */
	public String getAddress() {
		return address;
	}

	/**
	 * @param address
	 *            the address to set
	 */
	public void setAddress(String address) {
		this.address = address;
	}

	/**
	 * @return the port
	 */
	public int getPort() {
		return port;
	}

	/**
	 * @param port
	 *            the port to set
	 */
	public void setPort(int port) {
		this.port = port;
	}

	/**
	 * @return the context
	 */
	public String getContext() {
		return context;
	}

	/**
	 * @param context
	 *            the context to set
	 */
	public void setContext(String context) {
		this.context = context;
	}

}
